<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>访问属性</title>
    <script type="text/javascript" src="../js/jquery-3.4.1.min.js"></script>
    <script>
        $(function(){
           // $("img").click(function(){
           //    console.log($(this).attr("src"));
           //    $(this).attr("src","../images/3.jpg");
           //    $(this).removeAttr("src");
           // });
            $("img").click(function(){
                console.log($(this).prop("src"));
                $(this).prop("src","../images/3.jpg");
            });
        });
    </script>
</head>
<body>
<img src="../images/heihei.gif" alt="图片加载失败">
</body>
</html>